/*
 An DocRecord is a collection of documents
 */

package GraphsWindowPackage.DocRecordPackage;
import GraphsWindowPackage.Entry;

/**
 * @author quang
 */


public class DocRecord extends Entry {
    public var documents: Document[] = null; //sequence of documents

    public override function createEntryInTimeRange(minTime: Number, maxTime: Number): DocRecord {
        //if minRange > maxRange then return an empty medication
        if (minTime > maxTime) {
            return null;
        }
        else {
            var tempdocuments: Document[];
            for (i in [0..sizeof this.documents - 1]) {
                if (maxTime >= this.documents[i].time and this.documents[i].time >= minTime)
                    insert documents[i] into tempdocuments
            }
            return DocRecord {
                documents: tempdocuments
            }
        }
    }
}
